#pragma once

#include <vector>
#include <gmERBSEvaluator>
#include <gmPCurve>
#include <gmDMatrix>
#include "gmTorBezier.h"


namespace GMlib 
{
	template <typename T>
	class ERBS : public PCurve<T>
	{
	public:
		ERBS( T size );
		ERBS( PCurve<T>* inpCurve, int numLocalCurves, int deg);
		ERBS( const ERBS<T>& copy );
		virtual ~ERBS();
		void genKnotVector(T start, T end);

		std::string getIdentity() const;
		bool isClosed() const;

	protected:
		T _size;
		bool _isClosed;

		void eval(T t, int d, bool l);
		T getEndP();
		T getStartP();
		DVector<PTorBezier<T>*> _localCurves;
		DVector<T> _knots;
		ERBSEvaluator<T> _ERBSEval;

	private:
	};
}

#include "ERBS.c"